<?php
require_once 'adminmenu.php';
?>
<div class="well">
    <h4>New comments:</h4><hr />
    <?php
    $content = new Models_Articles();
    $comments = $content->getNewComments();
    foreach ($comments as $comment)
    {
        $userData = $content->getUserDataComment($comment['user_id']);
        $article = $content->getArticle($comment['article_id']);
        ?>
            <div class="alert alert-info">
                <h4><?php echo $comment['title']; ?></h4>
                <?php echo $comment['body']; ?>
                <hr />
                <p class="" style="padding: 1px 1px; margin: -5px 0;">
                    <i class="icon-user"></i> <a href="#"><?php echo $userData['login'] . ' (' . $userData['first_name'] . '  ' . $userData['second_name']; ?>)</a> 
                    | <i class="icon-calendar"></i> <?php echo $comment['created']; ?>
                    | <i class="icon-edit"></i> <a href="/<?php $content->printPath(); ?>articles/show/<?php echo $article['id']; ?>"><?php echo $article['title']; ?></a>
                    | <a href="/<?php $content->printPath(); ?>admin/commentok/<?php echo $comment['id']; ?>" class="btn btn-success btn-mini"><i class="icon-ok icon-white"></i> Ok</a>
                    | <a href="/<?php $content->printPath(); ?>admin/commentremove/<?php echo $comment['id']; ?>" class="btn btn-danger btn-mini"><i class="icon-remove icon-white"></i> Delete</a>
                </p>
            </div>
        <?php
    }
    ?>
</div>